

package com.hazelcast.replicatedmap;

import com.hazelcast.nio.ObjectDataInput;
import com.hazelcast.nio.ObjectDataOutput;
import com.hazelcast.spi.merge.MergingValue;
import com.hazelcast.spi.merge.SplitBrainMergePolicy;

import java.io.IOException;

public class CustomReplicatedMapMergePolicy implements SplitBrainMergePolicy<Integer, MergingValue<Integer>, Integer> {

    @Override
    public Integer merge(MergingValue<Integer> mergingValue, MergingValue<Integer> existingValue) {
        return mergingValue.getDeserializedValue();
    }

    @Override
    public void writeData(ObjectDataOutput out) throws IOException {

    }

    @Override
    public void readData(ObjectDataInput in) throws IOException {

    }
}
